//
//  ExchangeRateCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/22.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "ExchangeRateCell.h"

@interface ExchangeRateCell ()
@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UILabel *leftLabel;
@property (weak, nonatomic) IBOutlet UILabel *rightTopLabel;
@property (weak, nonatomic) IBOutlet UILabel *rightBottomLabel;
@property (weak, nonatomic) IBOutlet UILabel *middleTopLabel;
@property (weak, nonatomic) IBOutlet UILabel *middleBottomLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *middleLabelH;
@end

@implementation ExchangeRateCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.leftLabel.font = MYFONT(16);
    
    self.rightTopLabel.font = MYFONT(16);
    
    self.rightBottomLabel.font = MYFONT(12);
    
    self.rightBottomLabel.textColor = darkGray;
    
    
    self.middleTopLabel.font = MYFONT(16);
    
    self.middleBottomLabel.font = MYFONT(12);
    
    self.middleBottomLabel.textColor = darkGray;
    
    self.contentView.backgroundColor = [UIColor whiteColor];
    
//    [self.leftImageView sd_setImageWithURL:[NSURL URLWithString:@"http://e.hiphotos.baidu.com/zhidao/pic/item/d50735fae6cd7b89d2f399e50d2442a7d9330e3c.jpg"] placeholderImage:nil];
    // Initialization code
}

- (void)setModel:(NSArray *)model{
    _model = model;
    
    NSString *leftStr = _model[0];
    NSString *middleStr = _model[1];
    NSString *rightStr = _model[2];
    
    self.middleLabelH.constant = myViewModel.huiLvLabelH;
    
    self.leftLabel.text = leftStr;
    
    self.middleTopLabel.text = middleStr;

    self.rightTopLabel.text = rightStr;
    
    if ([leftStr isEqualToString:@"CNY"]) {
        
        self.rightBottomLabel.text = @"人民币¥";
        
        self.middleBottomLabel.text = @"人民币¥";

        self.leftImageView.image = [UIImage imageNamed:@"CNY"];

        
    } else if ([leftStr isEqualToString:@"EUR"]){
        
        self.rightBottomLabel.text = @"欧元€";
        self.middleBottomLabel.text = @"欧元€";
        
        self.leftImageView.image = [UIImage imageNamed:@"EUR"];
    }else if ([leftStr isEqualToString:@"USD"]){
        
        self.rightBottomLabel.text = @"美元$";
        self.middleBottomLabel.text = @"美元$";
        
        self.leftImageView.image = [UIImage imageNamed:@"USD"];
    }else if ([leftStr isEqualToString:@"JPY"]){
        
        self.rightBottomLabel.text = @"日元JPY￥";
        self.middleBottomLabel.text = @"日元JPY￥";
        
        self.leftImageView.image = [UIImage imageNamed:@"JPY"];
    }else if ([leftStr isEqualToString:@"GBP"]){
        
        self.rightBottomLabel.text = @"英镑￡";
        self.middleBottomLabel.text = @"英镑￡";
        
        self.leftImageView.image = [UIImage imageNamed:@"GBP"];
    }else if ([leftStr isEqualToString:@"HKD"]){
        
        self.rightBottomLabel.text = @"港币HK$";
        self.middleBottomLabel.text = @"港币HK$";
        
        self.leftImageView.image = [UIImage imageNamed:@"HKD"];
    }else{
        
        self.rightBottomLabel.text = @"";
        self.middleBottomLabel.text = @"";
        
        self.leftImageView.image = [UIImage imageNamed:@""];
    }
    
    
    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
